package org.framework.core.override.context;

import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;

import org.framework.core.Configation;
import org.springframework.web.context.ContextLoaderListener;

@WebListener
public class ContextListener extends ContextLoaderListener {

	private ContextRegister register;
	
	@Override
	public void contextInitialized(ServletContextEvent event) {
		super.contextInitialized(event);
		this.register = ContextRegister.createContextRegister(getCurrentWebApplicationContext());
		this.register.initContextRegister();
	}
	
	@Override
	public void contextDestroyed(ServletContextEvent event) {
		super.contextDestroyed(event);
		Configation.getInstance().getTimer().cancel();
	}
	
}
